/*
 * Employee.java
 *
 * This class stores details about an employee and defines methods to display
 * them.
 *
 * Copyright 2007 Aptech Software Limited. All Rights Reserved.
 */

package employeeannotation;

/**
 * This class uses the deprecation annotation to declare a method as deprecated.
 * @author vincent
 */
public class Employee {
  
  /** Creates a new instance of Employee */
  public Employee() {
  }
  
  /**
   * Creates and initialises a new instance of Employee.
   * @param name the name of the employee
   * @param date the date of birth of the employee
   * @param salary the current salary drawn by the employee
   * @param designation the designation of the employee
   */
  public Employee(String name, String date, double salary,
      String designation) {
    this.name = name;
    this.dateOfBirth = date;
    this.currentSalary = salary;
    this.designation = designation;
  }
  
  /**
   * This method is invoked to display the details of an Employee.
   */
  // Standard annotation to declare the display() method to be deprecated
  @Deprecated
      public void display() {
    System.out.println("This is the output from the deprecated " +
        "display() method.");
  }
  
  /**
   * This method can be overridden by subclasses of the Employee class.
   */
  public void showEmployeeDetails(){
    System.out.println("Name:" + name);
    System.out.println("Date of Birth:" + dateOfBirth);
    System.out.println("Current Salary:" + currentSalary);
    System.out.println("Designation:" + designation);
  }
  
  /** Instance variable to store the name of the employee. */
  protected String name;
  
  /** Instance variable to store the date of birth of the employee. */
  protected String dateOfBirth;
  
  /** Instance variable to store the current salary drawn by the employee. */
  protected double currentSalary;
  
  /** Instance variable to store the designation of the employee. */
  protected String designation;
}
